*Table 1
use "$root/data/cleaned/bg_created", replace

capture erase "$root\output\table1.txt"
local outregfile "$root\output\table1"

foreach depvar in listseduc wants_at_least_college listsexper exper {
	sum `depvar'
	local meandepvar= r(mean)

	reghdfe `depvar' count_tech non_tech_skills , absorb(czone yearmonth) cluster(czone) 
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs  alpha(0.001, 0.01, 0.05) symbol(***, **, * )

	sum `depvar' if non_singleton==1
	local meandepvar= r(mean) 
	reghdfe `depvar' count_tech non_tech_skills if non_singleton==1, absorb(czone yearmonth) cluster(czone) 
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs alpha(0.001, 0.01, 0.05) symbol(***, **, * )

	sum `depvar' if non_singleton==1&emp_id!=.
	local meandepvar= r(mean) 
	reghdfe `depvar' count_tech non_tech_skills if non_singleton==1, absorb( czone_year emp_year narrow_employer yearmonth) cluster(emp_id) 
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs alpha(0.001, 0.01, 0.05) symbol(***, **, * )

	sum `depvar' if non_singleton==1&ad_czone_id!=.
	local meandepvar= r(mean) 
	reghdfe `depvar' count_tech non_tech_skills if non_singleton==1, absorb(ad_czone_id czone_year emp_year narrow_employer yearmonth) cluster(emp_id)
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs alpha(0.001, 0.01, 0.05) symbol(***, **, * )
}


*Table 2
use "$root/data/cleaned/bg_created", replace

capture erase "$root\output\table2.txt"
local outregfile "$root\output\table2"

foreach depvar in basic_aa clerk mail routine_accounting light_physical legal accounting_finance sales_cust marketing logistics hr research higher_level_mgmt other_cognitive writing {
	sum `depvar' if non_singleton==1&emp_id!=.
	local meandepvar= r(mean) 
	reghdfe `depvar' count_tech non_tech_skills if non_singleton==1, absorb( czone_year emp_year narrow_employer yearmonth) cluster(emp_id) 
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs  alpha(0.001, 0.01, 0.05) symbol(***, **, * )
}

*Table A.3
use "$root/data/cleaned/bg_created", replace
capture log close

putexcel set "$root\output\tableA3.xls", sheet(Sheet1) replace

tabstat listseduc wants_at_least_hs wants_at_least_college educ_cond listsexper exper, stat(mean sd n) save
matrix results = r(StatTotal)'
putexcel A1 = matrix(results), names nformat(number_d2)

tabstat listseduc wants_at_least_hs wants_at_least_college educ_cond listsexper exper if non_singleton==1, stat(mean sd n) save
matrix results = r(StatTotal)'
putexcel E1 = matrix(results), names nformat(number_d2)


*Table A.5
putexcel set "$root\output\tableA5.xls", sheet(Sheet1) replace

tabstat basic_aa clerk mail routine_accounting light_physical legal accounting_finance sales_cust marketing logistics hr research higher_level_mgmt other_cognitive writing bc_top100 pc_top100 wc_male_top100 wc_female_top100, stat(mean sd n) save
matrix results = r(StatTotal)'
putexcel A1 = matrix(results), names nformat(number_d2)

tabstat basic_aa clerk mail routine_accounting light_physical legal accounting_finance sales_cust marketing logistics hr research higher_level_mgmt other_cognitive writing bc_top100 pc_top100 wc_male_top100 wc_female_top100 if non_singleton==1, stat(mean sd n) save
matrix results = r(StatTotal)'
putexcel E1 = matrix(results), names nformat(number_d2)


*Table B.1
use "$root/data/cleaned/bg_created", replace

capture erase "$root\output\tableB1.txt"
local outregfile "$root\output\tableB1"

foreach depvar in basic_aa clerk mail routine_accounting light_physical legal accounting_finance sales_cust marketing logistics hr research higher_level_mgmt other_cognitive writing {
	sum `depvar' if non_singleton==1&ad_czone_id!=.
	local meandepvar= r(mean) 
	reghdfe `depvar' count_tech non_tech_skills if non_singleton==1, absorb(ad_czone_id czone_year emp_year narrow_employer yearmonth) cluster(emp_id)
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs alpha(0.001, 0.01, 0.05) symbol(***, **, * )
}


*Table B.2
use "$root/data/cleaned/bg_created", replace

capture erase "$root\output\tableB2.txt"
local outregfile "$root\output\tableB2"

foreach depvar in cognitive social character writing projectmanage peoplemanage financial customerservice {
	sum `depvar' if non_singleton==1&emp_id!=.
	local meandepvar= r(mean) 
	reghdfe `depvar' count_tech non_tech_skills if non_singleton==1, absorb( czone_year emp_year narrow_employer yearmonth) cluster(emp_id) 
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs alpha(0.001, 0.01, 0.05) symbol(***, **, * )
}


*Table B.4
use "$root/data/cleaned/bg_created", replace

capture erase "$root\output\tableB4.txt"
local outregfile "$root\output\tableB4"

foreach depvar in bc_top100 pc_top100 wc_male_top100 wc_female_top100 {

	sum `depvar'
	local meandepvar= r(mean)

	reghdfe `depvar' count_tech non_tech_skills , absorb(czone yearmonth) cluster(czone) 
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs alpha(0.001, 0.01, 0.05) symbol(***, **, * )

	sum `depvar' if non_singleton==1
	local meandepvar= r(mean) 
	reghdfe `depvar' count_tech non_tech_skills if non_singleton==1, absorb(czone yearmonth) cluster(czone) 
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs alpha(0.001, 0.01, 0.05) symbol(***, **, * )

	sum `depvar' if non_singleton==1&emp_id!=.
	local meandepvar= r(mean) 
	reghdfe `depvar' count_tech non_tech_skills if non_singleton==1, absorb( czone_year emp_year narrow_employer yearmonth) cluster(emp_id) 
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs alpha(0.001, 0.01, 0.05) symbol(***, **, * )

	sum `depvar' if non_singleton==1&ad_czone_id!=.
	local meandepvar= r(mean) 
	reghdfe `depvar' count_tech non_tech_skills if non_singleton==1, absorb(ad_czone_id czone_year emp_year narrow_employer yearmonth) cluster(emp_id)
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs alpha(0.001, 0.01, 0.05) symbol(***, **, * )
}

*Table B.5
capture erase "$root\output\tableB5.txt"
local outregfile "$root\output\tableB5"

foreach depvar in management_top100 business_top100 legal_top100 sales_top100 {
	sum `depvar'
	local meandepvar= r(mean)

	reghdfe `depvar' count_tech non_tech_skills , absorb(czone yearmonth) cluster(czone) 
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs alpha(0.001, 0.01, 0.05) symbol(***, **, * )

	sum `depvar' if non_singleton==1
	local meandepvar= r(mean) 
	reghdfe `depvar' count_tech non_tech_skills if non_singleton==1, absorb(czone yearmonth) cluster(czone) 
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs alpha(0.001, 0.01, 0.05) symbol(***, **, * )

	sum `depvar' if non_singleton==1&emp_id!=.
	local meandepvar= r(mean) 
	reghdfe `depvar' count_tech non_tech_skills if non_singleton==1, absorb( czone_year emp_year narrow_employer yearmonth) cluster(emp_id) 
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs alpha(0.001, 0.01, 0.05) symbol(***, **, * )

	sum `depvar' if non_singleton==1&ad_czone_id!=.
	local meandepvar= r(mean) 
	reghdfe `depvar' count_tech non_tech_skills if non_singleton==1, absorb(ad_czone_id czone_year emp_year narrow_employer yearmonth) cluster(emp_id)
	outreg2 using `"`outregfile'"', keep(*count_tech*) dec(5) excel addt(totobs, `e(N_full)') adds(meandepvar, `meandepvar', `"% Relative to Mean:"', `=_b[count_tech]/`meandepvar'*100' ) nocons nor2 noobs alpha(0.001, 0.01, 0.05) symbol(***, **, * )
}
